Skip to content

Use deb822-style APT repository configuration#560

Open
merlinz01 wants to merge 1 commit into
docker:masterfrom
merlinz01:559-deb822
Open

Use deb822-style APT repository configuration#560
merlinz01 wants to merge 1 commit into
docker:masterfrom
merlinz01:559-deb822

Conversation

@merlinz01
Copy link
Copy Markdown

Fixes #559

- What I did

Refactor Docker repository setup to support new deb822 format and provide warnings for existing configurations.

- How I did it

Typing on a keyboard, I guess.

- How to verify it

Install on recent Debian or Ubuntu. /etc/apt/sources.list.d/debian.sources should contain something like this:

Types: deb
URIs: https://download.docker.com/linux/debian
Suites: trixie
Components: stable
Architectures: amd64
Signed-By: /etc/apt/keyrings/docker.asc

- Description for the changelog

Use deb822-style APT repository configuration on Debian/Ubuntu versions that support it.

- A picture of a cute animal (not mandatory but encouraged)

chipmunk

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! left some quick comments after glancing over.

Comment thread install.sh
Comment on lines +559 to +564
use_deb822=true
case "$lsb_dist.$dist_version" in
debian.jessie|ubuntu.trusty)
use_deb822=false
;;
esac
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we already make these old distros a hard failure, so we can probably skip this check; older distros are no longer supported by the script, so it's fine if things would fail.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any hard failure here. Is that in some other component?

        # Print deprecation warnings for distro versions that recently reached EOL,
        # but may still be commonly used (especially LTS versions).
        case "$lsb_dist.$dist_version" in
                centos.8|centos.7|rhel.7)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                debian.buster|debian.stretch|debian.jessie)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                raspbian.buster|raspbian.stretch|raspbian.jessie)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                ubuntu.focal|ubuntu.bionic|ubuntu.xenial|ubuntu.trusty)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                ubuntu.oracular|ubuntu.mantic|ubuntu.lunar|ubuntu.kinetic|ubuntu.impish|ubuntu.hirsute|ubuntu.groovy|ubuntu.eoan|ubuntu.disco|ubuntu.cosmic)
                        deprecation_notice "$lsb_dist" "$dist_version"
                        ;;
                fedora.*)
                        if [ "$dist_version" -lt 41 ]; then
                                deprecation_notice "$lsb_dist" "$dist_version"
                        fi
                        ;;
        esac

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right; it's not a hard failure (we may have in the past), but it sleeps for 10 seconds and a warning;

deprecation_notice() {

Regardless, we should prefer keeping the script focused on what's still supported, and try to avoid complexity for things no longer supported; users can still download older versions of the script, or (better) create their own implementation targeted at their situation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should I change it to a hard fail for those distro versions?

Comment thread install.sh
Comment on lines +568 to +573
if [ -f /etc/apt/sources.list.d/docker.list ]; then
echo
echo "# WARNING: An existing Docker APT repository file using the sources.list format was found at /etc/apt/sources.list.d/docker.list."
echo "# Please remove this file to avoid conflicting repository settings."
echo
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a warning if the script detects that docker is installed already (as its main purpose is for fresh installs, not upgrades); honestly, I think we can keep it simple; assume the docker.list is created either by this script, or manually, but for the docker installation, so just remove it;

if [ -f /etc/apt/sources.list.d/docker.list ]; then
	rm -f /etc/apt/sources.list.d/docker.list
fi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Refactor Docker repository setup to support new deb822 format and provide warnings for existing configurations.

Signed-off-by: merlinz01 <158784988+merlinz01@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debian/Ubuntu installation should use deb822 .sources format

3 participants